package com.gz.tomcat.http;


import java.io.OutputStream;

//GzResponse可以封装OutputStream(和socket关联)
//即通过GzResponse对象 返回Http响应给浏览器
//GzResponse作用等价于原生的servlet的HttpServletResponse(那个参数)
public class GzResponse {

    private OutputStream outputStream = null;
    private final String respHeader = "HTTP/1.1 200\r\n" +
            "Content-Type: text/html;charset=utf-8\r\n\r\n";

    public GzResponse(OutputStream outputStream) {
        this.outputStream = outputStream;
    }

    //本质是servlet的getWriter()
    public OutputStream getOutputStream() {
        return outputStream;
    }

    public String getRespHeader() {
        return respHeader;
    }
}

